<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>number1:{{number1}} <button @click="add">+</button></h2>
      <button @click="()=>{ number1++; }">+</button>
    </div>
    <script type="module">
      import { createApp, ref } from "./vue.esm-browser.js";
      const app = createApp({
        setup() {
          // 组合
          const number1 = ref(100);
          const add = function () {
            number1.value++;
          };
          return {
            number1,
            add,
          };
        },
      });
      app.mount("#app"); //挂载
    </script>
  </body>
</html>
